package mt.Junit;
import static org.junit.Assert.*;

import mt.Order;
import mt.comm.ServerMessage;

import org.junit.Before;
import org.junit.Test;

public class JUnitServerMessage {

	private ServerMessage  sermes;
	private Order or;	
	
	@Before
	public void setUp() {
		or = Order.createBuyOrder("Joana", "Google", 50, 15);
		sermes = new ServerMessage(ServerMessage.Type.NEW_ORDER, or, or.getNickname());
	}

	@Test
	public void test() {
		assertEquals(sermes.getType(),ServerMessage.Type.NEW_ORDER);
		assertEquals(sermes.getOrder(),or);
		assertEquals(sermes.getSenderNickname(), or.getNickname());
	}
}
